import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
     redirect:'/index1',
    children:[
       {path: '/index1', component: () => import('../views/index1/Index1.vue')},
       {path: '/addParkinglot', component: () => import('../views/parkinglot/AddParkinglot.vue')},
       {path: '/editParkinglot', component: () => import('../views/parkinglot/EditParkinglot.vue')},
       {path: '/addGarage', component: () => import('../views/garage/AddGarage.vue')},
       {path: '/editGarage', component: () => import('../views/garage/EditGarage.vue')},
       {path: '/ChargeRule', component: () => import('@/views/bill/ChargeRule.vue')},
       {path: '/addParkCard', component: () => import('../views/parkCard/AddParkCard.vue')},
       {path: '/editParkCard', component: () => import('../views/parkCard/EditParkCard.vue')},
       {path: '/editEquipment', component: () => import('../views/equipment/EditEquipment.vue')},
       {path: '/parkRecord', component: () => import('../views/parkRecord/ParkRecord.vue')},
       {path: '/payRecord', component: () => import('../views/bill/PayRecord.vue')},
       {path: '/payRecordDetail', component: () => import('../views/bill/PayRecordDetail.vue')},
       {path: '/userParkCard', component: () => import('../views/parkCard/UserParkCard.vue')},
       {path: '/userInfo', component: () => import('../views/user/UserInfo.vue')},
       {path: '/editAdmin', component: () => import('../views/user/EditAdmin.vue')},
       {path: '/addAdmin', component: () => import('../views/user/AddAdmin.vue')},
       {path: '/addRole', component: () => import('../views/role/AddRole.vue')},
       {path: '/editRole', component: () => import('../views/role/EditRole.vue')},
       {path: '/blacklist', component: () => import('../views/user/Blacklist.vue')},
      {path: '/operationLog', component: () => import('../views/other/OperationLog.vue')},
      {path: '/carEntryAndExit', component: () => import('../views/other/CarEntryAndExit.vue')}
    ]
  },
  {path: '/login', component: () => import('../views/LoginView')}
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router